package com.xinminda.dcf.test;

import com.alibaba.fastjson.JSON;
import com.xinminda.dcf.bean.PostTestBean;

public class RequestParams {

    /*{
                "clientVersion": "2.0",
                    "deviceId": "1234567890",
                    "from": "ios",
                    "method": "token",
                    "userId": 0
    }*/
    public static String getToken(){
        PostTestBean postTestBean = new PostTestBean();
        postTestBean.setVersion("2.0");
        postTestBean.setDeviceId("1234567890");
        postTestBean.setFrom("ios");
        postTestBean.setMethod("token");
        postTestBean.setUserId(0);
        String header = JSON.toJSONString(postTestBean);
        return header;

    }

    public static String getHeader(String method){
        Header header = new Header();
        header.setVersion("2.0");
        header.setDeviceId("1234567890");
        header.setFrom("ios");
        header.setMethod(method);
        header.setToken("6ac2f9d863704560be07f350ae4bfe90");
        header.setUserId(0);
        return JSON.toJSONString(header);

    }

    public static String getLoginParams(String username, String password){
        LoginParams loginParams = new LoginParams();
        loginParams.setUsername(username);
        loginParams.setPassword(password);
        String params = JSON.toJSONString(loginParams);
        return params;
    }

    public static String getNewsListParams(int id, int page, int rows){
        NewsListParams newsListParams = new NewsListParams();
        newsListParams.setColumnId(id);
        newsListParams.setPage(page);
        newsListParams.setRows(rows);
        String params = JSON.toJSONString(newsListParams);
        return params;
    }
}
